﻿using System;
using System.Collections.Generic;
using System.Linq;
using Scrabble.Model.Properties;

namespace Scrabble.Model.Events
{
    internal class TilesExchangedEvent : GameEvent
    {
        public TilesExchangedEvent(IPlayer player, IEnumerable<Tile> tiles) : base(player, 0, tiles)
        {
            Description = String.Format(Resources.Description_Exchanged, MovedTiles.Length);
        }

        public override string ToNotation()
        {
            return new String(MovedTiles.Select(tile => tile.Letter).ToArray());
        }

        protected override string TypeOfAction
        {
            get { return ActionType.Exchange; }
        }
    }
}